package cn.iocoder.yudao.module.trade.api.brokerage;

import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.module.trade.api.brokerage.dto.BrokerageUserRespDTO;
import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageUserDO;
import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageUserService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;

@Service
@Validated
public class BrokerageUserApiImpl implements BrokerageUserApi {
    @Resource
    private BrokerageUserService brokerageUserService;

    @Override
    public BrokerageUserRespDTO getOrCreateBrokerageUser(Long id) {
        BrokerageUserDO orCreateBrokerageUser = brokerageUserService.getOrCreateBrokerageUser(id);
        return BeanUtil.toBean(orCreateBrokerageUser, BrokerageUserRespDTO.class);
    }
}
